/*
 * Copyright (c) 2019 Actions Semiconductor Co., Ltd
 *
 * SPDX-License-Identifier: Apache-2.0
 */

/**
 * @file system event map
 */
#include <sys_event.h>
#include <app_ui.h>

static const struct sys_event_ui_map sys_event_map[] = {
	#if 0
	{SYS_EVENT_ENTER_SDMPLAYER,		UI_EVENT_ENTER_SDMPLAYER,	false},
	#else
	{SYS_EVENT_POWER_OFF,			UI_EVENT_POWER_OFF,			true},
	{SYS_EVENT_BATTERY_LOW,			UI_EVENT_LOW_POWER,			true},
	{SYS_EVENT_BATTERY_TOO_LOW,		UI_EVENT_NO_POWER,			true},

	{SYS_EVENT_FACTORY_DEFAULT,		UI_EVENT_FACTORY_DEFAULT,	false},
	{SYS_EVENT_CLEAR_PAIRED_LIST,	UI_EVENT_CLEAR_PAIRED_LIST,	false},
	{SYS_EVENT_BT_WAIT_PAIR,		UI_EVENT_WAIT_CONNECTION,	false},
	{SYS_EVENT_ENTER_PAIR_MODE,		UI_EVENT_ENTER_PAIRING,		false},
	//{SYS_EVENT_TWS_START_PAIR,		UI_EVENT_TWS_START_TEAM,	false},
	//{SYS_EVENT_TWS_CONNECTED,		UI_EVENT_TWS_TEAM_SUCCESS,	false},
	//{SYS_EVENT_TWS_DISCONNECTED,	UI_EVENT_TWS_DISCONNECTED,	false},
	//{SYS_EVENT_TWS_PAIR_FAILED,		UI_EVENT_TWS_PAIR_FAILED,	false},
	//{SYS_EVENT_2ND_CONNECTED,		UI_EVENT_SECOND_DEVICE_CONNECT_SUCCESS, false},
	{SYS_EVENT_BT_CONNECTED,		UI_EVENT_CONNECT_SUCCESS,	false},
	{SYS_EVENT_BT_DISCONNECTED,		UI_EVENT_BT_DISCONNECT,		false},

	{SYS_EVENT_MAX_VOLUME,			UI_EVENT_MAX_VOLUME,		false},
	{SYS_EVENT_MIN_VOLUME,			UI_EVENT_MIN_VOLUME,		false},
	{SYS_EVENT_PLAY_START,			UI_EVENT_PLAY_START,		false},
	{SYS_EVENT_PLAY_PAUSE,			UI_EVENT_PLAY_PAUSE,		false},
	{SYS_EVENT_PLAY_PREVIOUS,		UI_EVENT_PLAY_PREVIOUS,		false},
	{SYS_EVENT_PLAY_NEXT,			UI_EVENT_PLAY_NEXT,			false},

	{SYS_EVENT_SIRI_STOP,			UI_EVENT_STOP_SIRI,			false},
	{SYS_EVENT_SIRI_START,			UI_EVENT_START_SIRI,		false},
	{SYS_EVENT_BT_START_CALL,		UI_EVENT_BT_START_CALL,		false},
	{SYS_EVENT_BT_CALL_INCOMING,	UI_EVENT_BT_INCOMING,		true},
	{SYS_EVENT_BT_CALL_OUTGOING,	UI_EVENT_BT_OUTGOING,		true},
	{SYS_EVENT_BT_CALL_ONGOING,		UI_EVENT_BT_ONGOING,		true},
	{SYS_EVENT_MIC_MUTE_ON,			UI_EVENT_MIC_MUTE,			false},
	{SYS_EVENT_MIC_MUTE_OFF,		UI_EVENT_MIC_MUTE_OFF,		false},
	{SYS_EVENT_BT_CALL_END,			UI_EVENT_BT_HANG_UP,		false},

	{SYS_EVENT_ENTER_BTMUSIC,		UI_EVENT_ENTER_BTMUSIC,		false},
	//{SYS_EVENT_ENTER_SPDIF_IN,		UI_EVENT_ENTER_SPDIF_IN,	false},
	{SYS_EVENT_ENTER_I2SRX_IN,		UI_EVENT_ENTER_I2SRX_IN,	false},
	{SYS_EVENT_ENTER_LINEIN,		UI_EVENT_ENTER_LINEIN,		false},
	{SYS_EVENT_ENTER_USOUND,		UI_EVENT_ENTER_USOUND,		false},
	//{SYS_EVENT_ENTER_SDMPLAYER,		UI_EVENT_ENTER_SDMPLAYER,	false},
	{SYS_EVENT_ENTER_UMPLAYER,		UI_EVENT_ENTER_UMPLAYER,	false},
	//{SYS_EVENT_ENTER_NORMPLAYER,	UI_EVENT_ENTER_NORMPLAYER,	false},
	//{SYS_EVENT_ENTER_SDPLAYBACK,	UI_EVENT_ENTER_SDPLAYBACK,	false},
	//{SYS_EVENT_ENTER_UPLAYBACK,		UI_EVENT_ENTER_UPLAYBACK,	false},
	//{SYS_EVENT_ENTER_RECORD,		UI_EVENT_ENTER_RECORD,		false},
	{SYS_EVENT_ENTER_MIC_IN,		UI_EVENT_ENTER_MIC_IN,		false},
	{SYS_EVENT_ENTER_FM,			UI_EVENT_ENTER_FM,			false},
	{SYS_EVENT_KEYTONE_MP3,			UI_EVENT_KEYTONE_MP3,			false},
	#endif
};

int system_event_map_init(void)
{
	sys_event_map_register(sys_event_map, ARRAY_SIZE(sys_event_map), 0);
	return 0;
}
